#ifndef __BUFFER_H__
#define __BUFFER_H__
#include <memory>

class Buffer
{
public:
    typedef std::shared_ptr<Buffer> ptr;
    Buffer();

    void Read(void* buf, int len);

    int ReadInt();

    //写入数据，数据的长度为size
    void Write(const void* data, int size);

    //写入int
    void WriteInt(int value);

    const char* GetBuffer();

    int GetSize();
private:
    char m_buffer[1024];
    int m_size;
};

#endif // !__BUFFER_H__
